<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>无标题文档</title>
    <link th:href="@{/css/style.css}" rel="stylesheet" type="text/css"/>
    <th:block th:include="public::common-script"></th:block>
    <script th:src="@{/layer/layer.js}" type="text/javascript"></script>
    <style>
        [name=subject] {
            position: relative;
            top: 2px;
        }
        .mli{
            width: 60px!important;
        }
    </style>
</head>

<body th:if="${clazzList.size()>0}">

<div class="place">
    <span>位置：</span>
    <ul class="placeul">
        <li><a href="#">行政管理</a></li>
        <li><a href="#">考试发布</a></li>
    </ul>
</div>

<div class="formbody">

    <div class="formtitle"><span>全校统一考试发布</span></div>

    <ul class="forminfo">
        <li><label>考试名称</label><input name="name" type="text" class="dfinput"/></li>
        <li>
            <label>考试班级</label>
            <select name="clazzIds" type="text" class="dfinput" multiple style="height: 100px;"/>
            <option
                    th:each="clazzItem:${clazzList}"
                    th:text="${clazzItem.created+'级 '+clazzItem.name}"
                    th:value="${clazzItem.id}"
            ></option>
            </select>
        </li>
        <li><label>考试科目</label>
            <label class="mli"><input name="subject" type="checkbox" class="quanxuan"/>全选</label>
            <label class="mli"><input name="subject" type="checkbox" class=""/>语文</label>
            <label class="mli"><input name="subject" type="checkbox" class=""/>数学</label>
            <label class="mli"><input name="subject" type="checkbox" class=""/>英语</label>
        </li>
        <li><label>考试科目 (文)</label>
            <label class="mli"><input name="subject" type="checkbox" class="quanxuan"/>全选</label>
            <label class="mli"><input name="subject" type="checkbox" class=""/>政治</label>
            <label class="mli"><input name="subject" type="checkbox" class=""/>历史</label>
            <label class="mli"><input name="subject" type="checkbox" class=""/>地理</label>
        </li>
        <li><label>考试科目 (理)</label>
            <label class="mli"><input name="subject" type="checkbox" class="quanxuan"/>全选</label>
            <label class="mli"><input name="subject" type="checkbox" class=""/>物理</label>
            <label class="mli"><input name="subject" type="checkbox" class=""/>化学</label>
            <label class="mli"><input name="subject" type="checkbox" class=""/>生物</label>
        </li>
        <li style="margin-top: 50px;"><label>&nbsp;</label><input name="" type="button" class="btn" value="确认发布"/></li>
    </ul>
</div>
<script type="text/javascript">
$(".quanxuan").click(function () {
    if(this.checked){
        $(this).parent().siblings().children().prop("checked","checked")
    }else {
        $(this).parent().siblings().children().prop("checked",null)

    }
})
</script>
</body>
<body th:if="${clazzList.size()==0}">
<center>
    <p style="margin: 200px auto 0;text-align: center;font-size: 48px;color: red;">无法发布考试信息</p>
    <p style="margin: 20px auto 0;text-align: center;font-size: 16px;color: #d3d3d3;">
        可能的原因：你还不是任何班级的班主任。只有班主任才可以发布考试信息！</p>
</center>
</body>
</html>
